* Clean up
clear all

/* Set working directory: please set your own
cd "~/Dropbox/JOP third submission/JOP replication/"
*/

* Open dataset
use 01_data/cis_data.dta, clear

* Generate interaction
gen cabine_use_pp_dummy = cabine_use * pp_dummy

* Run analyses
regr uncomfortable cabine_use pp_dummy cabine_use_pp_dummy, r
est store uncomf_nocontrols
estadd local Controls "No"
estadd local FE "No"

regr uncomfortable cabine_use pp_dummy cabine_use_pp_dummy i.CCAA, r
est store uncomf_fe
estadd local Controls "No"
estadd local FE "Yes"

regr uncomfortable cabine_use pp_dummy cabine_use_pp_dummy female i.income i.TAMUNI age age_sq i.education, r
est store uncomf_controls
estadd local Controls "Yes"
estadd local FE "No"

regr uncomfortable cabine_use pp_dummy cabine_use_pp_dummy female i.income i.TAMUNI age age_sq i.education i.CCAA, r
est store uncomf_fe_controls
estadd local Controls "Yes"
estadd local FE "Yes"

* Make table
esttab uncomf_nocontrols uncomf_controls uncomf_fe uncomf_fe_controls using 03_tables/table6.tex, tex se replace  keep (cabine_use pp_dummy cabine_use_pp_dummy) coeflabels (cabine_use "Used a booth to vote" pp_dummy "Voted for PP" cabine_use_pp_dummy "Used booth x voted PP") star(* 0.10 ** 0.05 *** 0.01) s(Controls FE, label("Controls" "Region fixed effects")) nomtitles addnotes("Standard errors are robust" "The outcome variable is a dummy for whether each respondent showed" "signs of discomfort during the survey interview" "Models 2 and 4 include controls for income, education, age, age squared, size of" "respondent's municipality, and a dummy for respondents identifying as female") scalars(e(N))
